var htmlWP = require('html-webpack-plugin');

module.exports={
  entry:'./src/main.js',  //指定打包的入口文件
  output:{
  	path : __dirname+'/dist',  // 注意：webpack1.14.0 要求这个路径是一个绝对路径
  	filename:'build.js'
  },
  module:{
  	loaders:[
  		{
  			test: /\.css$/,
  			loader:'style-loader!css-loader'
  		},
      {
        test:/\.scss$/,
        loader:'style-loader!css-loader!sass-loader'
      },
      {
        test:/\.less/,
       loader:'style-loader!css-loader!less-loader'
      },
    
        {
        test:/\.(png|jpg|gif|ttf)$/,
        loader:'url-loader?limit=20000'//表示图片大小的临界值是20k
      },
      {
        test:/\.js$/,
        loader:'babel-loader',
        exclude:/node_modules/
      },
      {
        test:/.vue$/,
        loader:'vue-loader'
      }
  	]
  },
  babel:{
    presets:['es2015'],
    plugins:['transform-runtime']
  },
  plugins:[
  new htmlWP({
    title:'首页',
    filename:'index.html',
    template:'index1.html'
  })
  ]
}